﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>innerHTML属性</title>
    <script>
        function myDOMInnerHTML() {
            var myDiv = document.getElementById("myTest");
            alert(myDiv.innerHTML);
            myDiv.innerHTML = "<img src='02.jpg' title='美丽风光'>";
        }
    </script>
</head>
<body onload="myDOMInnerHTML()">
    <div id="myTest">
        <span>图库</span>
        <p>这是一行用于测试的文字</p>
    </div>
</body>
</html>